#ifndef XIMAGE_H
#define XIMAGE_H

#include "thesct.h"
#include "xbitmap.h"

#include <QWidget>
#include <QtGui>
#include <QMouseEvent>
#include <QPaintEvent>
#include <QResizeEvent>
#include <QColor>
#include <QPixmap>
#include <QPoint>
#include <QPainter>
#include <QPalette>
#include <QImage>


class XImage : public QWidget
{
    Q_OBJECT
public:
    explicit XImage(QWidget *parent = 0);
    void paintEvent(QPaintEvent *);
    void resizeEvent(QResizeEvent *);
    int load_bitmap(XBitmap *bmp);

    int translate(XImage &src);
    int DrawWithTSTHPSV(XImage &src,PCTSTHPSV pTSTHPSV);

private:
    unsigned long m_mt;
    unsigned long m_nt;
    unsigned long m_buf_size;
    QImage * m_qimg;

    int m_m;
    int m_n;
    int m_x;
    int m_y;
    bool m_translated;
private:
    void set_pos();
};

#endif // XIMAGE_H
